package com.cmy.framework_network.commoninterceptor

import android.util.Log
import okhttp3.Interceptor
import okhttp3.Response

/**
 * 获取请求数据（目前使用时查看请求时间）
 */
class CommonResponseInterceptor  : Interceptor {

    companion object{
        private const val TAG = "ResponseInterceptor"
    }


    override fun intercept(chain: Interceptor.Chain): Response {
        val requestTime = System.currentTimeMillis()
        val response = chain.proceed(chain.request())
        Log.d(TAG, "requestTime=" + (System.currentTimeMillis() - requestTime)
        )
        return response
    }
}